package com.example.opengldemo.vertex_magical.shader;

import android.content.res.Resources;

import com.example.opengldemo.util.MatrixState;

public class LazyRenderer extends BaseRenderer {


    public LazyRenderer(Resources resource) {
        super(resource,"vertexmagical/base_vert.sh","vertexmagical/base_frag.sh");
    }
    public LazyRenderer(Resources resource ,String vert, String frag) {
        super(resource,vert,frag);
    }


    public LazyRenderer(String vert, String frag){
        super(null,vert,frag);
    }

    public LazyRenderer(){
        super(null,
                "#version 300 es\n" +
                        "in vec3 aPosition;\n" +
                        "in vec3 aNormal;\n" +
                        "in vec2 aTexCoors;\n" +
                        "\n" +
                        "uniform mat4 uMVPMatrix ;\n" +
                        "uniform mat4 uTMatrix;\n" +
                        "\n" +
                        "out vec2 vTextureCo;\n" +
                        "\n" +
                        "void main(){\n" +
                        "    gl_Position = uMVPMatrix*vec4(aPosition,1) ;\n" +
                        "    vTextureCo = (uTMatrix*vec4(aTexCoors,0,1)).xy;\n" +
                        "}",
                "#version 300 es\n" +
                        "precision mediump float;\n" +
                        "\n" +
                        "uniform sampler2D sTexture;\n" +
                        "\n" +
                        "in vec2 vTextureCo;\n" +
                        "\n" +
                        "out vec4 fragColor ;\n" +
                        "\n" +
                        "void main() {\n" +
                        "    fragColor = texture( sTexture, vTextureCo);\n" +
                        "}");
    }

}
